package cn.stylefeng.guns.modular.customer.entity;

import cn.stylefeng.guns.modular.course.entity.Course;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 用户订单表
 * </p>
 *
 * @author typ
 * @since 2021-04-25
 */
@TableName("yy_order")
@Data
public class Order implements Serializable {

    private static final long serialVersionUID=1L;

      @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

      @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 支付时间
     */
    @TableField("pay_time")
    private Date payTime;

    /**
     * 订单金额
     */
    @TableField("amount")
    private String amount;

    /**
     * 用户id
     */
    @TableField("customer_id")
    private Integer customerId;

    /**
     * 课程id
     */
    @TableField("course_id")
    private Integer courseId;

    /**
     * 视频id
     */
    @TableField("video_id")
    private Integer videoId;

    @TableField("order_no")
    private String orderNo;

    @TableField(exist = false)
    private Course course;


    /*

    0待付款 1 已付款
     */
    @TableField("state")
    private Integer state;



    @Override
    public String toString() {
        return "Order{" +
        "id=" + id +
        ", createTime=" + createTime +
        ", payTime=" + payTime +
        ", amount=" + amount +
        ", customerId=" + customerId +
        ", courseId=" + courseId +
        ", videoId=" + videoId +
        "}";
    }
}
